/************************************************************************************************
 * test examples of 100 interesting program in C
 * test 028.c
 * who's square is palindrome
 ***********************************************************************************************/

#include <stdio.h>

/*
 *
 */

#define MAX 0x7FFF

int main()
{
    int i = 0;
    for (i = 1; i < MAX; i++)
    {
        int square = i*i, j = 0, sum = 0;
        for (j = square; j > 0; j /= 10)
            sum = sum*10 + j%10;
        if (sum == square)
        printf("%5d's square is palindrome: %10d\n", i, square);
    }
}

